﻿<Page x:Class="DemoApp.PopupEditPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      Title="Component List"
      x:Name="theList">

    <Popup Name="dialogPopUp" StaysOpen="True" Placement="Center">
        <Border>
            <Border.Background>
                <LinearGradientBrush>
                    <GradientStop Color="Gray" Offset="1"></GradientStop>
                    <GradientStop Color="Silver" Offset="0"></GradientStop>
                </LinearGradientBrush>
            </Border.Background>
            <Grid Margin="5" Background="White">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid Grid.Row="0" Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Label Grid.Row="0"
                           Content="Language:"
                           Margin="0" />
                    <ComboBox x:Name="cmbLanguage" 
                              Grid.Row="1"
                              HorizontalAlignment="Left"
                              Width="200"
                              Margin="5"
                              SelectedIndex="0">
                    </ComboBox>
                    <Label Grid.Row="2"
                            Content="Method Name:"
                            Margin="0" />
                    <TextBox x:Name="txtMethodName" 
                             Grid.Row="3"
                             HorizontalAlignment="Left"
                             Width="200"
                             Margin="5"
                             FocusManager.FocusedElement="{Binding ElementName=txtMethodName}" />  
                    <Label Grid.Row="4"
                           Content="Method Code:"
                           Margin="0" />
                    <TextBox x:Name="txtMethodCode" 
                             Grid.Row="5"
                             HorizontalAlignment="Left"
                             Width="200"
                             Margin="5"
                             Height="150"
                             AcceptsReturn="True"
                             TextWrapping="Wrap" />
                </Grid>
                <ListView Grid.Row ="0" Grid.Column="1" 
                        Name="lvMethodList"
                        SelectionChanged="lvMethodList_SelectionChanged">
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Method Name"
                                                DisplayMemberBinding="{Binding}" />
                            </GridView>
                        </ListView.View>
                </ListView>
                <StackPanel Grid.Row="1"
                            Grid.ColumnSpan="2"
                            Orientation="Horizontal"
                            HorizontalAlignment="Right">
                <Button x:Name="btnInsert" 
                        IsDefault="True"
                        Content="Insert Method"
                        Click="Insert_Click"
                        Margin="5"
                        Width="100"
                        Height="30" />
                <Button x:Name="btnUpdate" 
                        Content="Update Method"
                        IsEnabled="False"
                        Click="Update_Click"
                        Margin="5"
                        Width="100"
                        Height="30" />
                <Button x:Name="btnDelete" 
                        Content="Delete Method"
                        IsEnabled="False"
                        Click="Delete_Click"
                        Margin="5"
                        Width="100"
                        Height="30" />
                <Button Content="Close"
                        IsCancel="True"
                        Click="Close_Click"
                        Margin="5"
                        Width="100"
                        Height="30" />
                </StackPanel>
            </Grid>
        </Border>
    </Popup>
</Page>
